<!doctype html public \"-//W3C//DTD HTML 4.0 Transitional//EN\">

<html>
<meta http-equiv="imagetoolbar" content="no">
<head>
<title>Scott Porter</title>

<style type="text/css">
BODY{overflow:hidden}
P{margin-left:2px;margin-right:2px;font-family:Arial,Helvetica,sans-serif;size:16px;color:#222233}
H1{padding:2px;border:1px solid black;font-family:Arial,Helvetica,sans-serif;font-size:24px;color:#000000;background-color:#88ff88}
.slant{font-style: italic}
</style>

<script type="text/javascript" src="../gamelib/gamelib_widgets.js"></script>

<script language="Javascript">

var ready=false;

function init(){	// First we have to initialise the WidgetManager. Our resource directory is "widget_resources"...
	InitWidgetManager('widget_resources','init2()');
}

function init2(){

// So now we're all initialised, let's set the ready flag to true so that windows can be opened...

	ready=true;
}

function MakeWindow(){
	if(!ready){
		alert("Hold on, I haven't initialised yet!");
		return
	}
	var myMenuBar=null;
	 myWindow=null;
	var sub1,sub2,sub3,sub9;

// Ok, first we'll make the first menu, called 'File' (hey, I'm just a coder, I'm never claimed to be original!).

	sub1=new Gl_Menu('File','#bbbbbb','#ffffff',false,false,false,false,false,false,80);

		sub1.addItem('Search','widgetManager.searchWindow()',null,'search.gif');
		sub1.addItem('Print','widgetManager.doWindowPrint()',null,'print.gif');

// We'll add a sub menu to the 'File' menu, called Options. The two items are just dummies. They do nothing...

	sub2=new Gl_Menu('Options','#00ff00','#008800',false,false,false,false,false,false,80);

		sub2.addItem('Option 1','return');
		sub2.addItem('Option 2','return');

		sub1.addMenu(sub2);
		sub1.addItem('Exit','widgetManager.destroyWindow()',null,'fileexit.gif');

// Now we'll create another menu to add to the menuBar (a top-level menu). You can see the method I use to load new
// pages into the current window from a menu item here...

	sub3=new Gl_Menu('Info','#bbbbbb','#ffffff',null,null,null,null,null,null,80);
		sub3.addItem('About Scott!','widgetManager.windows[widgetManager.activeWindowIX].load("widget_example_page1.html")');
		sub3.addItem('Portfolio','widgetManager.windows[widgetManager.activeWindowIX].load("widget_example_page2.html")');
		sub3.addItem('Status','widgetManager.windows[widgetManager.activeWindowIX].load("widget_example_page3.html")');
		sub3.addItem('Music','widgetManager.windows[widgetManager.activeWindowIX].load("widget_example_page4.html")');

// Finally we'll add the standard Help menu. This has one item called About, that will spawn a new window with some 'about' text.

	sub9=new Gl_Menu('Help','#bbbbbb','#ffffff',null,null,null,null,null,null,80);
		sub9.addItem('About','widgetManager.windows[widgetManager.activeWindowIX].load("widget_example_page5.html")',null,'help.gif');

// Now the 3 top-level menus have been created, it's time to add them to a menuBar...

	myMenuBar=new Gl_MenuBar(500);
		myMenuBar.addMenu(sub1);
		myMenuBar.addMenu(sub3);
		myMenuBar.addMenu(sub9);

// Now let's make a window, and add the menuBar and a statusBar...

	myWindow=widgetManager.createWindow(400,300,"About Me!",null,null,'widget_example_page1.html',WMs_m.x,WMs_m.y);
		myWindow.addMenuBar(myMenuBar);
		myWindow.addStatusBar();

// Give the statusBar some default text...

	myWindow.setStatus('All your base are belong to us!');
}

</script>
</head>
<body bgcolor="#eeeeff" scroll="no" onload="init()">
<h1>
Widget Example 1
</h1>
<p>
Press the button to create a new window!
</p>
<form onsubmit="return false">
<input type="button" onclick="MakeWindow()" value="NEW WINDOW!" />
</form>
</body>
</html>